data  = 'register||{"username":"${username}","password":"wulaoshi999","email": "wulaoshi@qq.com"}'

import re
username = "wulaohi1"
if re.search(r"\$\{(\w+)\}",data):
    var_name = re.search(r"\$\{(\w+)\}",data).group(1)
    var_value = eval(var_name)
    print(1,var_value,var_name)
    data = re.sub(r"\$\{(\w+)\}",var_value,data)
    print(data)

print(eval('1111'))
'''
b= 'aaa'
d= eval(b)
print(1,b)
'''